package com.easy.customer.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.easy.common.bean.CustomerInteractions;
import com.easy.common.util.ResultData;
import com.easy.customer.service.CustomerInteractionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("interaction")
public class CustomerInteractionsController {
    @Autowired
    CustomerInteractionsService customerInteractionsService;
    @PostMapping("/")
    public ResultData insert(@RequestBody CustomerInteractions interactions) {
        CustomerInteractions result = customerInteractionsService.insert(interactions);
        return ResultData.success(result);
    }
    @PutMapping("/")
    public ResultData update(@RequestBody CustomerInteractions interactions) {
        CustomerInteractions result = customerInteractionsService.update(interactions);
        return ResultData.success(result);
    }
    @GetMapping("/page")
    public ResultData getListByPage(@RequestBody IPage page) {
        IPage<CustomerInteractions> result = customerInteractionsService.getListByPage(page);
        return ResultData.success(result);
    }
}
